package com.touchalachs.game;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.touchalachs.R;
import com.touchalachs.core.Updatable;

public class Res {

	public static String ALREADY_OWNED;
	public static String LACHSE;
	public static String PRICE;
	public static String BUY;
	public static String LPS;
	public static String STATS;
	public static String STATS_TEXT;
	public static String RESET;
	public static String[] WORKER_TITLES;
	public static String[] WORKER_DESCRIPTIONS;
	public static Bitmap WATER;
	public static Bitmap FISH;
	public static Bitmap[] WORKER_ICONS;
	private static volatile boolean commit = false;
	
	
	public static void init(Resources resources) {
		WATER = BitmapFactory.decodeResource(resources, R.drawable.water);
		FISH = BitmapFactory.decodeResource(resources, R.drawable.salmonback);
		WORKER_ICONS = new Bitmap[]{
				BitmapFactory.decodeResource(resources, R.drawable.rod),
				BitmapFactory.decodeResource(resources, R.drawable.bear),
				BitmapFactory.decodeResource(resources, R.drawable.boat),
				BitmapFactory.decodeResource(resources, R.drawable.chemistry)};
		
		LACHSE = resources.getString(R.string.lachse);
		PRICE = resources.getString(R.string.price);
		ALREADY_OWNED = resources.getString(R.string.alreadyOwned);
		RESET = resources.getString(R.string.reset);
		LPS = resources.getString(R.string.LpS);
		BUY = resources.getString(R.string.buy);
		STATS = resources.getString(R.string.stats);
		STATS_TEXT = resources.getString(R.string.statsText);
		WORKER_TITLES = new String[]{
				resources.getString(R.string.worker_title_0),
				resources.getString(R.string.worker_title_1),
				resources.getString(R.string.worker_title_2),
				resources.getString(R.string.worker_title_3)};
		WORKER_DESCRIPTIONS = new String[]{
				resources.getString(R.string.worker_desc_0),
				resources.getString(R.string.worker_desc_1),
				resources.getString(R.string.worker_desc_2),
				resources.getString(R.string.worker_desc_3)};
		
		commit = true;
	}

	static class ResThreadVisibilityEnsurer implements Updatable{
		@Override
		public void update(float deltaSec) {
			if (commit){
				//do nothing
			}
		}
	}
	
}
